package rpt.yto.flex.remote.data.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import rpt.yto.flex.remote.data.dao.IUserDAO;

public class UserDAO extends SqlMapClientDaoSupport implements IUserDAO {

	@Override
	public void saveUser(String usercode) throws Exception {
		getSqlMapClientTemplate().insert("saveUser" , usercode);
	}

	@Override
	public Map<String, Object> queryUserByCode(String usercode)
			throws Exception {
		
		List<Map<String , Object>> results = getSqlMapClientTemplate().queryForList("queryByUsercode", usercode);
		
		if(results == null || results.size() == 0)
			return null;
		
		return results.get(0);
		
	}

}
